package tezhongbing;

public class NoVisiabilityTest {
	private static class ReadThread extends Thread{
		private volatile boolean ready;
		private int number;
		
		public void run(){
			while(!ready){
				number++;
			}
			System.out.println(ready);
		}
		public void readyOn(){
			this.ready = true;
		}
	}
	public static void main(String[] args) throws InterruptedException {
		ReadThread readThread = new ReadThread();
		readThread.start();
		Thread.sleep(200);
		readThread.readyOn();
		System.out.println(readThread.ready);
	}
}
